import { $http } from './index';

// 三方系统跳转带 token 时，通过 token 重新获取登录信息
export function getWechatLoginUserInfo(code = '') {
    return $http.get(`wl/wechat/login/personalWechatLogin?code=${code}&type=0`);
}

export function sendSms(data = {}) {
    return $http.post('/md/user/sendSms', data);
}

export function loginBySms(params = {}) {
    return $http.post('/md/auth/phoneLogin', params);
}

// 校验屏盟用户
export function checkPmUserPhone4Login(phoneNum = '') {
    return $http.get(`/ls/login/checkPmUserPhone4Login?phoneNum=${phoneNum}`);
}

// 获取验证码
export function getSmsVerifyCode(clientId = '') {
    return $http.get(`/md/image/verifyCode?clientId= ${clientId}`);
}

// 退出登录
export function logOff() {
    return $http.get('/pl/pack/login/logout');
}
